//
//  SGBuyPageViewController.m
//  cherryproduct
//
//  Created by zou shigang on 14/9/28.
//  Copyright (c) 2014年 cherry. All rights reserved.
//

#import "SGBuyPageViewController.h"

@interface SGBuyPageViewController ()<UIWebViewDelegate>

@property(nonatomic, strong) UIWebView * webview;

@end

@implementation SGBuyPageViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self setTitle:@"参加团购"];
    //[self addNavBarButton:RIGHT_SHARE_MESSAGE];
    
    if (self.webview==nil) {
        self.webview = [[UIWebView alloc] initWithFrame:self.myView.bounds];
        self.webview.backgroundColor=[UIColor whiteColor];
        self.webview.delegate=self;
        [self.myView addSubview:self.webview];
    }
    NSURLRequest * request =[NSURLRequest requestWithURL:[NSURL URLWithString:self.str_url_page]];
    [self.webview loadRequest:request];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/
#pragma mark -
#pragma mark UIWebViewDelegate
- (void)webViewDidStartLoad:(UIWebView *)webView;
{
    [self.view startLoadingAnimation];
}
- (void)webViewDidFinishLoad:(UIWebView *)webView;
{
    [self.view stopLoadingAnimation];
}
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error;
{
    [self.view stopLoadingAnimation];
}

#define CocoaJSHandler @"mpajaxhandler"

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType;
{
    return YES;
}

@end


















